#include <stdio.h>
#include "scarasolver.h"

double rad2deg(double rad) {
	return rad * 180.0/PI;
}

int main ()
{
	// initialize a solver for an arm with distance from shoulder to elbow 55 and distance from elbow to wrist 50
	ScaraSolver sol = ScaraSolver(55, 50);

	double angle1, angle2;
	for(int x = 10; x <= 70; x += 30) {
		for (int y = 10; y <= 70; y += 30) {
			sol.solve(x, y, &angle1, &angle2);
			printf ("To get to (%d, %d): 1st angle %lf, 2nd angle %lf.\n",
				x, y, rad2deg(angle1), rad2deg(angle2) );
		}
		printf("\n");
	}

	getchar();
	return 0;
}